import { LoadingOutlined, PlusOutlined } from "@ant-design/icons";

interface UploadButtonProps {
  loading: boolean;
  url: string;
}

const UploadButton = ({ url, loading }: UploadButtonProps) => {
  if (url) {
    return <img src={url} alt="avatar" style={{ width: "100%" }} />;
  } else {
    return (
      <div>
        {loading ? <LoadingOutlined /> : <PlusOutlined />}
        <div style={{ marginTop: 8 }}>添加图片</div>
      </div>
    );
  }
};

export default UploadButton;
